export const state = () => ({
    operator_name: "",
    token: "",
});

export const getters = {
    isLoggedIn: state => {
        return state.token !== "";
    },
    token: state => {
        return state.token;
    },
};

export const mutations = {
    setOperator(state, { operator_name, token }) {
        state.operator_name = operator_name;
        state.token = token;
        setLocalStorage("token", token);
    },
    logout(state) {
        state.operator_name = "";
        state.token = "";
    },
};
